package cn.iocoder.yudao.module.vos.dal.mysql.datamatchtask;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.vos.dal.dataobject.datamatchtask.DataMatchTaskDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.vos.controller.admin.datamatchtask.vo.*;

/**
 * 数据匹配下载 Mapper
 *
 * @author shijun
 */
@Mapper
public interface DataMatchTaskMapper extends BaseMapperX<DataMatchTaskDO> {

    default PageResult<DataMatchTaskDO> selectPage(DataMatchTaskPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DataMatchTaskDO>()
                .likeIfPresent(DataMatchTaskDO::getTaskName, reqVO.getTaskName())
                .eqIfPresent(DataMatchTaskDO::getTaskParams, reqVO.getTaskParams())
                .eqIfPresent(DataMatchTaskDO::getTaskStatus, reqVO.getTaskStatus())
                .betweenIfPresent(DataMatchTaskDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(DataMatchTaskDO::getRetrievalDays, reqVO.getRetrievalDays())
                .eqIfPresent(DataMatchTaskDO::getDownloadUrl, reqVO.getDownloadUrl())
                .eqIfPresent(DataMatchTaskDO::getMatchType, reqVO.getMatchType())
                .orderByDesc(DataMatchTaskDO::getId));
    }

}